﻿using ApiDoc.Models;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WQDSkin.Forms.Component;

namespace ApiDoc.Admin.View.Api
{
    /// <summary>
    /// frmStepEdit.xaml 的交互逻辑
    /// </summary>
    public partial class frmStepEdit : Window
    {
        private HttpClientApi httpClient;
        public frmStepEdit()
        {
            InitializeComponent();
        }


        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
             

            this.httpClient = new HttpClientApi();
        }

        private async void btnSave_Click(object sender, RoutedEventArgs e)
        {
            bool bOK = FormHelp.Verifiy(this.frmMain);
            if (bOK)
            {

                FlowStepModel model = (FlowStepModel)this.DataContext;
                int result = await this.httpClient.StepSave(model);
                if (result > 0)
                {
                    this.DialogResult = true;
                    this.Close();
                }
            }
        }
    }
}
